package edu.usc.libtalk;

import edu.usc.libtalk.utils.Globals;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class EmailActivity extends Activity {
	private String emailText = "";
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		/**
		 * Note: this activity will only work on the actual device and not
		 * on the emulator.
		 */
	    super.onCreate(savedInstanceState);
	    Intent intent = new Intent(Intent.ACTION_SEND);
	    intent.setType("plain/text");
	    intent.putExtra(Intent.EXTRA_EMAIL,new String[] { "address@example.com" });
	    intent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
	    // body of email
	    emailText = Globals.getInstance().getMsgBoardText();
	    intent.putExtra(Intent.EXTRA_TEXT, emailText);
	    //Toast.makeText(this, Globals.getInstance().getMsgBoardText(), Toast.LENGTH_SHORT).show();
	    startActivity(Intent.createChooser(intent, "Choose an Email client :"));
	}
}
